<%--
  Created by IntelliJ IDEA.
  User: 刘弗莫尔
  Date: 2021/10/13
  Time: 11:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>ajax03.jsp</title>
</head>
<body>
<input type="button" id="btn02" name="btn02" value="点击测试test02"/>
<input type="button" id="btn03" name="btn03" value="点击测试test03"/>
</body>
</html>
<script src="${pageContext.request.contextPath}/webjars/jquery/3.5.1/jquery.min.js">

</script>
<script type="text/javascript">
    $(document).ready(function (){
        $("#btn02").click(function (){
            $.ajax({
                type: "GET",
                url: "${pageContext.request.contextPath}/ajax/test02",
                success: function(msg){
                    alert( "ajax返回springmvc处理的结果为：" + msg );
                }
            });
        });
        $("#btn03").click(function (){
            $.ajax({
                type: "GET",
                url: "${pageContext.request.contextPath}/ajax/test03",
                success: function(msg){
                    alert( "ajax返回springmvc处理的结果为：" + msg );
                }
            });
        });
    });
</script>
